using System;
using System.Globalization;
using jSLApp.Client.MainService;
using jSLCore.Client.Presentation.jBinding;

namespace jSLApp.Client.Converters
{
    /// <summary>
    /// Detects if any rate is present within the comment
    /// </summary>
    public class HasAnyRateConverter : jChainConverter
    {
        public override object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var comment = value as Comment;
            if (comment == null) return value;

            return comment.RateDance != null || comment.RateMusic != null || comment.RateQuality != null;
        }

        public override object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}